<?php

/**
 * SigmaCMS - Content Management System
 *
 * Copyright (C) 2008 Pavol Biely
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    SigmaCMS
 * @author     Pavol Biely <pavolbiely@gmail.com>
 * @copyright  2008 Pavol Biely
 * @license    http://www.gnu.org/licenses/gpl.txt   GNU General Public License
 * @link       http://pabi3.com/
 * @since      0.1.0
 */

if (!defined('INSTALLATION')) die('Access denied!');

echo "<h1>"._SIGMACMS_INSTALL."</h1>\n";
echo "<h2>"._STEP_4."</h2>\n";

echo "<form action='index.php?step=4' method='post'>\n";

echo "<fieldset>\n";
echo "<ol>\n";

echo "<li>\n";
echo "<label for='type'>"._DB_TYPE."</label>\n";
echo "<select id='type' name='type' tabindex='1'>\n";
echo "<option value=''>"._SELECT."</option>\n";
foreach ($cfg['database'] as $key => $value) {
	if (in_array($key,array('fbsql','mssql','postgresql'))) {
		echo "<option value='$key' disabled='disabled'>$value</option>\n";
	} else {
		echo "<option value='$key'>$value</option>\n";
	}
}
echo "</select>\n";
echo "</li>\n";

echo "<li>\n";
echo "<label for='host'>"._DB_HOST."</label>\n";
echo "<input id='host' name='host' value='localhost' type='text' class='text' tabindex='2' />\n";
echo "</li>\n";

echo "<li>\n";
echo "<label for='port'>"._DB_PORT."</label>\n";
echo "<input id='port' name='port' type='text' class='text' tabindex='3' /> "._NOT_REQUIRED."\n";
echo "</li>\n";

echo "<li>\n";
echo "<label for='database'>"._DB_DATABASE."</label>\n";
echo "<input id='database' name='database' type='text' class='text' tabindex='4' />\n";
echo "<input name='create' type='checkbox' /> "._DB_DATABASE_TTC."\n";
echo "</li>\n";

echo "<li>\n";
echo "<label for='username'>"._DB_USERNAME."</label>\n";
echo "<input id='username' name='username' type='text' class='text' tabindex='5' />\n";
echo "</li>\n";

echo "<li>\n";
echo "<label for='password'>"._DB_PASSWORD."</label>\n";
echo "<input id='password' name='password' type='text' class='text' tabindex='6' />\n";
echo "</li>\n";

echo "<li>\n";
echo "<label for='prefix'>"._DB_PREFIX."</label>\n";
echo "<input id='prefix' name='prefix' value='sigma_' type='text' class='text' tabindex='7' />\n";
echo "</li>\n";

echo "<li>\n";
echo "<label for='persistent'>"._DB_PERSISTENT."</label>\n";
echo "<input id='persistent' name='persistent' type='checkbox' tabindex='8' />\n";
echo "</li>\n";

echo "</ol>\n";
echo "</fieldset>\n";

echo "<fieldset class='submit'>\n";
echo "<input onclick='javascript:history.back()' type='button' value='"._PREVIOUS_STEP."' />\n";
echo "<input name='step4' type='submit' value='"._NEXT_STEP."' />\n";
echo "</fieldset>\n";

echo "</form>\n";
